home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pesquisa Dirigida
/
Pesquisa Dirigida.iso
/
JOGOS
/
buscandoanemo.swf
/
scripts
/
frame_28
/
DoAction.as
Wrap
Text File
|
2005-01-17
|
3KB
|
136 lines
function turtleRight()
{
if(turtleLeanAngle < turtleAngleMax - turtleAngleMove)
{
turtleLeanAngle += turtleAngleMove;
}
else
{
turtleLeanAngle = turtleAngleMax;
}
}
function turtleLeft()
{
if(- turtleAngleMax + turtleAngleMove < turtleLeanAngle)
{
turtleLeanAngle -= turtleAngleMove;
}
else
{
turtleLeanAngle = - turtleAngleMax;
}
}
function turtleUp()
{
if(- turtleVYMax + turtleVYMove < turtleVY)
{
turtleVY -= turtleVYMove;
}
else
{
turtleVY = - turtleVYMax;
}
}
function turtleDown()
{
if(turtleVY < turtleVYMax - turtleVYMove)
{
turtleVY += turtleVYMove;
}
else
{
turtleVY = turtleVYMax;
}
}
function createObsticle()
{
duplicateMovieClip("masterObsticle","obsticle" add dupeCounter,16384 + (dupeCounter + 100));
dupeCounter++;
if(dupeCounterMax < dupeCounter)
{
dupeCounter = 0;
}
}
function createPowerup()
{
duplicateMovieClip("masterPowerup","powerup" add dupeCounter,16384 + (dupeCounter + 100));
dupeCounter++;
if(dupeCounterMax < dupeCounter)
{
dupeCounter = 0;
}
}
function obsticleHitTurtle(whichObsticle)
{
if(turtleFlashing == 0 and gameOn == 1)
{
trace(whichObsticle add " hit turtle");
turtle.gotoAndPlay("flash");
sounds.gotoAndPlay("badObsticle");
scoreLocal -= scoreRemovedObsticle;
if(scoreLocal < 0)
{
scoreLocal = 0;
}
}
}
function powerupHitTurtle(whichPowerup)
{
if(gameOn == 1)
{
if(Math.random() < 0.5)
{
sounds.gotoAndPlay("goodObsticle1");
}
else
{
sounds.gotoAndPlay("goodObsticle2");
}
babyTurtlesCaught++;
scoreLocal += scorePowerup;
}
}
function turtleDied()
{
gameOn = 0;
sounds.gotoAndPlay("gnarly");
turtle.anim.stop();
path.stop();
if(distanceToTunnelForceConv >= dttfcStop)
{
if(_level10.getBytesLoaded() >= _level10.getBytesTotal() and 30 < _level10.getBytesTotal())
{
_level10.gotoAndPlay("playVideo");
}
screens.gotoAndStop("gameOver3");
}
else if(distanceToTunnelForceConv >= dttfcCutoff2)
{
screens.gotoAndStop("gameOver2");
}
else
{
screens.gotoAndStop("gameOver1");
}
}
function turtleFellOut()
{
trace("turtle fell out");
gameOn = 0;
turtleFallOff = 1;
turtleFallOffVX = -1 + Math.ceil((turtle._x - centerX) / 100000) * 2;
turtleFallOffVY = -1 + Math.ceil((turtle._y - centerY) / 100000) * 2;
trace("_x=" add turtle._x add " _y=" add turtle._y add " vx=" add turtleFallOffVX add " vy=" add turtleFallOffVY);
turtle.anim.stop();
path.stop();
turtleDied();
}
function restartCleanUp()
{
stopAllSounds();
removeMovieClip("turtle");
removeMovieClip("screens");
removeMovieClip("scoreboard");
gotoIntro = 1;
}